<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>素材中心</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/hyqcss/public.css">
	<style type="text/css">
		body{
			background: #e9e9e9;
		}
		/*公共头部带搜索*/
		.public_container{
			margin: 20px;
			background: #fff;
		}
		.public_title_container{
			height: 54px;
			padding: 0 20px;
			font-size: 14px;
			display: flex;
			align-items: center;
			background: #f9f9f9;
			border-bottom: 1px solid #f0f0f0;
		}
		.public_title_container a{
			margin-right: 30px;
			height: 54px;
			line-height: 54px;
			cursor: pointer;
		}
		.public_title_active{
			color: #1E9FFF;
			border-bottom: 1px solid #1E9FFF;
		}
		.public_buttonSearch_container{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 20px;
			background: #fff;
		}
		.public_Search_container{
			position: relative;
		}
		.public_Search_container input{
			width: 240px;
			height: 32px;
			border: 1px solid #d9d9d9;
		}
		.public_Search_container i{
			position: absolute;
			bottom: 6px;
			right: 10px;
			cursor: pointer;
		}
		/*公共头部带搜索 end*/
		.public_Search_content{
			display: flex;
		}
		.public_SearchSelect_content input{
			height: 32px;
		}
		.public_SearchSelect_content{
			margin-right: 10px;
		}
		.public_buttonSearch_content{
			display: flex;
		}
		.public_buttonSearch_content a{
			color: #fff;
			background-color: #1E9FFF;
			text-shadow: 0 -1px 0 rgba(0,0,0,.12);
			height: 24px;
			padding: 4px 15px;
			font-size: 14px;
			border-radius: 2px;
			display: flex;
			align-items: center;
		}
		.public_buttonSearch_content span{
			color: rgba(0,0,0,0.65);
			background-color: #fff;
			height: 32px;
			padding: 4px 15px;
			font-size: 14px;
			border-radius: 2px;
			display: flex;
			align-items: center;
			border: 1px solid #d9d9d9;
			margin-left: 10px;
		}
		.public_buttonSearch_daoruhuashu{
			margin-left: 10px;
		}
	</style>
</head>
<body>
	<form class="layui-form">
		<!-- 顶部提示框 结束 -->
	<div class="public_container">
		<!-- /*公共头部带搜索*/ -->
		<div class="public_content">
			<div class="public_title_container">
				<a href="index.html" class="public_title_active">短信模板列表</a>
				<a href="aliyun_config.html">阿里云配置</a>
			</div>
			<div class="public_buttonSearch_container">
				<div class="public_buttonSearch_content">
					<a href="add_sms_template.html">+ 新建模板</a>
				</div>
			</div>
		</div>
		</form>
		<!-- /*公共头部带搜索*/ end -->
		<!-- 公共表格部分 -->
		<div class="public_table_container">
			<table class="layui-table" lay-skin="line">
			
			    <thead>
			      <tr>
			        <th>模板名称</th>
			        <th>发送方式</th>
			        <th>短信签名</th>
			        <th>短信模板Code</th>
			        <th>短信内容</th>
			        <th>发送状态</th>
			        <th>创建时间</th>
			        <th>操作</th>
			      </tr>
			    </thead>
			    <tbody>
				{loop $templates as $template}
				<tr>
			        <td>{$template->name}</td>
			        <td>{$template->send_way == 1 ? '阿里云发送' : '系统发送'}</td>
			        <td>{$template->sign_name}</td>
			        <td>{$template->template_code}</td>
			        <td>{$template->content}</td>
			        <td>{$template->status == 1?'发送成功':'发送失败'}</td>
			        <td>{date("Y-m-d H:i:s",$template->ctime)}</td>
			        <td>
			        <!-- 	<button type="button" class="layui-btn layui-btn-sm layui-btn-normal" onclick="location.href='add_quick_reply-{$r->id}.html'">编辑</button> -->
			        	<a type="button" class="table-public-btn" onclick="del_sms_template({$template->id})">删除</a>
			        </td>
			      </tr>
				{/loop}
			      
			    </tbody>
			</table>
		</div>
		<!-- 公共表格部分 end-->
<!-- 		<div class="main-container-h pageing-container-h">
		        <div class="pageing-content-h">
		           <span>{$p->totalnum}条/{$p->totalpage}页</span> 
		        </div>
				<ul class="pageing-content-h">
		           {P weidogsadmin}
				</ul>
		    </div> -->
	</div>
	
	<script src="/cdn/jquery.js"></script>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script type="text/javascript">
		layui.use('form', function(){
		  var form = layui.form;
		  	
		  //监听提交
		  form.on('submit(formDemo)', function(data){
		    layer.msg(JSON.stringify(data.field));
		    return false;
		  });	
		  form.render('select');
		  
		 //  form.on('select(type)', function(data){
			// location.href="quick_reply.html?type="+data.value+"&name="+$('#name').val();
		 //  });
		});
		function del_sms_template(id){
			if(confirm('确定删除吗？')){
				myAjaxPost(false, true, 'delete_sms_template.html', { id:id}, function (resp) {
						if (resp.status == 'success') {
							tusi(resp.msg);
							setTimeout(function(){
								location.reload();
							},500);
						}else{
							alert(resp.msg);
						}
					});
			}
		}
	</script>
</body>
</html>